package com.excel2sql.chenjun.ui;

import java.awt.Font;
import java.util.Enumeration;

import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.plaf.FontUIResource;

public class MyJframe extends JFrame
{

	/**
	 * 
	 */
	private static final long serialVersionUID = 3116601078041080231L;
	
	// 设置全局统一字体
	private void InitGlobalFont(Font font)
	{
		FontUIResource fontRes = new FontUIResource(font);
		for (Enumeration<Object> keys = UIManager.getDefaults().keys(); keys.hasMoreElements();)
		{
			Object key = keys.nextElement();
			Object value = UIManager.get(key);
			if (value instanceof FontUIResource)
			{
				UIManager.put(key, fontRes);
			}
		}
	}
	
	public MyJframe()
	{
		//super();
		InitGlobalFont(new Font("微软雅黑", Font.BOLD, 14));
	}
	
}
